<?php

class FilenameConstructor
{
	public static function constructFilename($directory, $name, $extension)
	{
		$filename = '';
		if($directory !== null)
		{
			$filename .= $directory;
			if(!String::endsWith($filename, '/'))
				$filename .= '/';
		}
		if($name !== null)
			$filename .= $name;
		if($extension !== null)
			$filename .= '.'.$extension;
		return $filename;
	}
}

?>